/*
 * ConditionVariable.cpp
 *
 *  Created on: 20/06/2011
 *      Author: wadi
 */

#include "conditionvariable.h"

ConditionVariable::ConditionVariable()
{
  pthread_cond_init (&condition_variable, NULL);

}

ConditionVariable::~ConditionVariable()
{
  pthread_cond_destroy(&condition_variable);
}

void ConditionVariable::wait(Mutex& m){
  pthread_cond_wait(&condition_variable, &m.mutex);
}

void ConditionVariable::notify(){
  pthread_cond_signal(&condition_variable);
}
